#{extends 'organization.html' /} 
#{set title:'User Plans'/}

<h1 class="viewTitle">Your Plans :-</h1>
<div class="viewContent">

#{if ifUserNull==1}
<h2> You are not authorized to view this page</h2>
#{/if}
#{else}
#{if ownPlans.size() == 0}
<h2> You did not create any plans</h2>
#{/if}
	#{else}
	<h2> Your created plans..</h2>
    <div>
		#{table ownPlans, as: 'oP'}
			#{column 'Plan Title'}
				<a href = "@{Application.showPlan(oP.id)}" class="standardLink">
           			${oP.title}
           		 </a>
			#{/column}
			#{column 'Plan Start Date'}
				${oP.formatStartDate()}
			#{/column}
			#{column 'Plan End Date'}
				${oP.formatEndDate()}
			#{/column}
			#{column 'Plan Current Progress'}
				${oP.status}%
			#{/column}
			#{column 'Plan Description'}
				${oP.getSummarizedContent()}
			#{/column}
			
		#{/table}
	</div>
	#{/else}
	<br>
	#{if participateInPlans.size()==0}
	<h2> You are not participating in any plans..</h2>
	#{/if}
	#{else}
	<h1 class="viewTitle">Plans You Are Participating In :-</h1>
	<div>
		#{table participateInPlans, as: 'pIP'}
			#{column 'Plan Title'}
				<a href = "@{Application.showPlan(pIP.id)}" class="standardLink">
           			${pIP.title}
           		 </a>
			#{/column}
			#{column 'Plan Start Date'}
				${pIP.formatStartDate()}
			#{/column}
			#{column 'Plan End Date'}
				${pIP.formatEndDate()}
			#{/column}
			#{column 'Plan Current Progress'}
				${pIP.status}%
			#{/column}
			#{column 'Plan Description'}
				${pIP.getSummarizedContent()}
			#{/column}
			
		#{/table}
	</div>
	#{/else}
#{/else}
</div>